package zb.blog.base.exception;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ZbBlogException implements HandlerExceptionResolver {
    private static final Logger logger = LogManager.getLogger(ZbBlogException.class);

    @Override
    public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {
        logger.error(">>>>>>>>>>>>>>出现了一个小小的错误哦!!!>>>>>>>>>>>>>>>>>：" + e);
        e.printStackTrace();
        return null;
    }
}
